package com.ssy.lingxi.contract.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 *  合同关联订单金额日志(新增/取消订单[合同订单不允许修改])
 * @author ds
 * @version 2.0.0
 * @date 2021/4/15 9:17
 */
@Entity
@Table(schema = "public", name = "con_contract_order_amount_log",
        indexes = {@Index(name = "con_contract_order_amount_log_insert_x", columnList = "orderId,type",unique = true)})
public class ContractOrderAmountLogDO implements Serializable {

    private static final long serialVersionUID = -6579997052995086714L;
    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "contract_order_amount_log_seq")
    @SequenceGenerator(sequenceName = "con_contract_order_amount_log_seq", name = "contract_order_amount_log_seq", allocationSize = 1)
    private Long id;

    /**
     * 合同id
     */
    private Long contractId;
    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 操作类型： 1：添加订单，2：取消订单
     */
    @Column(columnDefinition = "int2")
    private Integer type;

    /**
     * 总计金额
     */
    private Double sumPrice;

    /**
     * 添加时间
     */
    private Long addTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Double getSumPrice() {
        return sumPrice;
    }

    public void setSumPrice(Double sumPrice) {
        this.sumPrice = sumPrice;
    }

    public Long getAddTime() {
        return addTime;
    }

    public void setAddTime(Long addTime) {
        this.addTime = addTime;
    }
}
